package main.locations

import main.models.{AbstractPlace, StateAction}
import main.person.Person
import main.state.{State, StateLens}

case class MoveAction (person: StateLens[Person], locationFrom: StateLens[AbstractPlace], locationTo: StateLens[AbstractPlace]) extends StateAction {
  override def apply(implicit state: State): State = {
    val state1 = locationFrom.removeChild(state, person)
    locationTo.addChild(state1, person)
  }
}
